#include<iostream>
#include<cmath>
using namespace std;

int to_int(string s) {
    int res = 0;
    int j = s.length();
    for(int i = 0; i < s.length(); i++) {
        int x = int(s[i] + '0');
        res += x * pow(10, j);
        j--;
    }

    return res;
}

int main(int argc, char const *argv[])
{
    string s1 = "2345";

    int sum = to_int(s1);
    cout << sum << endl;
    
    return 0;
}
